<%-- 
    Document   : moeda
    Created on : 12/12/2011, 16:36:04
    Author     : india
--%>

<%@page import="java.beans.beancontext.BeanContext"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <link rel="stylesheet" href="cmstyle.css"> 
        <title>Moeda</title>
    </head>
    <body>
        
            <ul class="navbar">
            <li><a href="javascript:window.history.go(-1)">Voltar</a>
            <li><a href="/conversorMedidas/"> Home Page </a>
            <li><a href="equipe.jsp">Quem somos?</a>
            <li><a href="volume.jsp">Volume</a>
            <li><a hred="moeda.jsp"> Moeda </a>
            </ul>
        
        <h1>Conversor de Moeda v1.3</h1>
       
       <%
       boolean opreal;
       double resReal=0;
        double resDolar=0;
        double resEuro=0;
        double resLibra=0;
        double resPeso=0;
        double qtdd=0;
                   
        
        if (Bean.getCheckedButton().equals("button1")){
            
        }
        if(request.getParameter("real")!=null||request.getParameter("dolar")!=null
                ||request.getParameter("euro")!=null||request.getParameter("peso")!=null
                ||request.getParameter("libra")!=null||request.getParameter("qtdd")!=null){
            if(request.getParameter("real")!=null){
                resReal = Double.parseDouble(request.getParameter("qtdd")) * 1;
                resDolar = Double.parseDouble(request.getParameter("qtdd"))*0.57 ; 
                resEuro= Double.parseDouble(request.getParameter("qtdd"))*0.41; 
                resLibra = Double.parseDouble(request.getParameter("qtdd")) *0.36 ; 
                resPeso = Double.parseDouble(request.getParameter("qtdd"))*1.66;}
            
            if(request.getParameter("dolar")!=null){
                resReal = Double.parseDouble(request.getParameter("qtdd")) * 1;
                resDolar = Double.parseDouble(request.getParameter("qtdd"))*0.57 ; 
                resEuro= Double.parseDouble(request.getParameter("qtdd"))*0.41; 
                resLibra = Double.parseDouble(request.getParameter("qtdd")) *0.36 ; 
                resPeso = Double.parseDouble(request.getParameter("qtdd"))*1.66;
            }
                               
        }                        
                                              
        
        %>

        <p><br><p><br><p><br><p>
    <center> <table border="2" cellspacing="0" ALIGN="CENTER"> <tr>  
      
          <form>
            <tr><th> Quantidade:</th> <td><input type="text" name="qtdd" value="<%=qtdd%>"/></td></tr>
            <tr><th>Real</th> <td><input type = "RADIO" name = "radioSet" value ="<%= bean.checkStatus("button1")%>" /> </td></tr>
            <tr><th>Em Real:</th> <td><input type="text" name="real" value="<%=resReal%>"/></td></tr>
            <tr><th>Em Dolar: </th> <td><input type="text" name="dolar" value="<%=resDolar%>"/></td></tr>
            <tr><th>Em Euro: </th> <td><input type="text" name="euro" value="<%=resEuro%>"/></td> </tr>
            <tr><th>Em Libra:</th> <td><input type="text" name="libra" value="<%=resLibra%>"/></td></tr>
            <tr><th>Em Peso: </th> <td><input type="text" name="peso" value="<%=resPeso%>"/></td> </tr>
            <tr><th colspan="2"><input type="Submit" value="Enviar" /></th>
        </form>      
            </tr> </table></center>
    </body>
</html>

<%/*
<form name="cadastro" method="post" action="testes.php">
  <b></b>Qual sua linguagem favorita?</b><br>
  <input name="linguagem" type="radio" 
    value="Java" checked>Java<br>
  <input type="radio" name="linguagem" 
    value="Delphi">Delphi<br>
  <input type="radio" name="linguagem" 
    value="C++">C++<br>
  <input type="radio" name="linguagem" 
    value="Python">Python<br>
  <input type="submit" value="Enviar!">
</form>
http://www.ibm.com/developerworks/java/library/j-sr4/index.html
 * http://java.sun.com/developer/technicalArticles/javaserverpages/maintain_button/
 * 

*/%>